﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <title>Accessory</title>
  <link href="../../skins/default.css" rel="stylesheet" />
  <style type="text/css" rel="stylesheet">
    body {
    margin: 0;
	font:12px/1.5 "sans serif",tahoma,verdana,helvetica;
	background-color:#F0F0EE;
	color:#222222;
	overflow:hidden;
    }
    input.url {
	width: 153px;
	}
    td.left1 {
    font-size:12px;
    width: 70px;
    padding: 2px;
    }
    td.right1 {
    font-size:12px;
    padding: 2px;
    } 
    .upload {
	position: relative;
	overflow: hidden;
	}  
	#attachFile {
	cursor:pointer;
	position: absolute;
	top: 0;
	right: 0;
	width: 70px;
	height: 25px;
	z-index: 811212;
	border: 0 none;
	opacity:0;
	filter:alpha(opacity=0);
	} 
  </style>
  <script type="text/javascript">   
    var KE = parent.KindEditor;
    var id = KE.util.getParam(location.href, 'id');	
    var accessoryUploadJson = (typeof KE.g[id].accessoryUploadJson == 'undefined') ? '../error.html' : KE.g[id].accessoryUploadJson;
	KE.event.ready(function() {
    	KE.$('uploadAccessoryForm', document).action = accessoryUploadJson;
    	var urlBox = KE.$('url', document);
    	var localUrlBox = KE.$('localUrl', document);
    	var viewLocalBox = KE.$('viewLocal', document);
    	var fileBox = KE.$('attachFile', document);
    	var lang = KE.lang.plugins.image;    	
    	KE.event.add(fileBox, 'change', function() {
			localUrlBox.value = fileBox.value;
		});
    	viewLocalBox.value = lang.viewServer;    	
    }, window, document);
    
    function showDownloadTip(v){
    	if(v == 0){
    		KE.$('downloadTip',document).style.visibility = 'hidden';
    	}
    	if(v == 1){
    		KE.$('downloadTip',document).style.visibility = 'visible';
    	}
    }
  </script>
</head>
<body>
  <iframe name="uploadIframe" id="uploadIframe" style="display:none;"></iframe>
  <input type="hidden" id="type" name="type" value="1" />
  <form id="uploadAccessoryForm" name="uploadForm" method="post" enctype="multipart/form-data" target="uploadIframe">
    <input type="hidden" id="editorId" name="editorId" value="" />
    <table border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td class="left1">
        	&nbsp;&nbsp;&nbsp;&nbsp;文件：
        </td>
        <td class="right1">
          <span class="ke-inline-block upload">
          <input type="text" id="localUrl" length="255" class="ke-inline-block ke-text-input url" readonly="true" />
		  <span class="ke-button-common ke-button-outer btn">
			<input type="button" class="ke-button-common ke-button" id="viewLocal" value=""/>
		  </span>  
		  <input type="file" id="attachFile" name="attachFile"/>  
		  </span>               
        </td>
      </tr>
      <tr>
        <td class="left1">&nbsp;&nbsp;&nbsp;&nbsp;说明：</td>
        <td class="right1">
          <input type="text" id="attachTitle" name="attachTitle" value="" maxlength="100" class="ke-inline-block ke-text-input" style="width: 220px"/>
        </td>
      </tr>
      <tr>
        <td class="left1">下载提示：</td>
        <td class="right1">
          <select onchange="showDownloadTip(this.value)" id="ddTip">
          	<option value="0" selected="selected">无</option>
          	<option value="1">有</option>
          </select> 
           <input type="text" id="downloadTip" name="downloadTip" value="" maxlength="100" class="ke-inline-block ke-text-input" style="width:175px;visibility:hidden" />
        </td>
      </tr>
    </table>
  </form>
</body>
</html>